<template>
  <div>
    <div class="head">
      <img class="head-1" src="../assets/head-logo.png" alt="" srcset="" />
      <div>
        <a-popover trigger="hover">
          <template #content>
            <div class="popover-btn border-b" @click="uploadList">上传列表</div>
            <div class="popover-btn border-b" @click="$refs.setRef.show()">
              设置
            </div>
            <div class="popover-btn border-b" @click="$refs.versionRef.show()">
              版本信息
            </div>
            <!-- <div class="popover-btn">退出账号</div> -->
          </template>
          <img class="head-img" src="../assets/icon/7.png" alt="" srcset="" />
        </a-popover>

        <img
          class="head-img"
          src="../assets/icon/4.png"
          @click="refreshPage"
          alt=""
          srcset=""
        />

        <img
          class="head-img"
          @click="minimizeWindow"
          src="../assets/icon/5.png"
          alt=""
          srcset=""
        />

        <img
          class="head-img"
          src="../assets/icon/6.png"
          @click="close"
          alt=""
          srcset=""
        />
      </div>
    </div>
    <UoloadList ref="uoloadListRef"></UoloadList>
    <version ref="versionRef"></version>
    <Set ref="setRef"></Set>
  </div>
</template>
<script>
import { ipcApiRoute } from "@/utils/ipcMainApi";
import { ipc } from "@/utils/ipcRenderer";

import UoloadList from "../components/uoloadList.vue";
import version from "../components/version.vue";
import Set from "../components/set.vue";

export default {
  components: {
    UoloadList,
    version,
    Set,
  },
  data() {
    return {};
  },
  created() {},
  mounted() {},
  methods: {
    refreshPage() {
      location.reload();
    },
    uploadList() {
      this.$refs.uoloadListRef.show();
    },
    close() {
      ipc.invoke(ipcApiRoute.close).then((id) => {});
    },
    minimizeWindow() {
      ipc.invoke(ipcApiRoute.minimize).then((id) => {});
    },

    onSubmit() {},
  },
};
</script>
<style lang="less" scoped>
.head {
  //   width: 100%;
  height: 60px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  -webkit-app-region: drag; //设置可以拖拽的区域
}

.head-1 {
  -webkit-app-region: drag; //设置可以拖拽的区域
}
.head-img {
  margin-left: 10px;
  cursor: pointer;
  -webkit-app-region: none; //设置可以拖拽的区域
}

.popover-btn {
  width: 80px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.border-b {
  border-bottom: 1px solid #e5e6eb;
}
</style>
